Skip Headers

Oracle® Label Security Administrator's Guide 10g Release 2 (10.2) Part Number B14267-02 |
Home | Book List | Contents | Index | Master Index | Feedback

Previous | Next
| View PDF

# 3 Understanding Access Controls and Privileges

Chapter 2, "Understanding Data Labels and User Labels" introduced the concept of labels (with their levels, compartments, and groups) and the basic notion of access control based on the row's data label and the user's label. This chapter examines the access controls and privileges that determine the type of access users can have to labeled rows.

This chapter contains these sections:

- Introducing Access Mediation

- Understanding Session Label and Row Label

- Understanding User Authorizations

- Evaluating Labels for Access Mediation

- Using Oracle Label Security Privileges

- Working with Multiple Oracle Label Security Policies

## 3.1 Introducing Access Mediation

To access data protected by an Oracle Label Security policy, a user must have authorizations based on the labels defined for the policy. Figure 3-1, "Relationships Between Users, Data, and Labels" illustrates the relationships between users, data, and labels.

- Data labels specify the sensitivity of data rows.

- User labels provide the appropriate authorizations to users.

- Access mediation between users and rows of data depends on users' labels.

Figure 3-1 Relationships Between Users, Data, and Labels

Description of "Figure 3-1 Relationships Between Users, Data, and Labels"

Note: Oracle Label Security enforcement options affect how access controls apply to tables and schemas. This chapter assumes that all policy enforcement options are in effect.

See Also: For more information, Refer to "Choosing Policy Options"

## 3.2 Understanding Session Label and Row Label

This section introduces the basic user labels.

- The Session Label

- The Row Label

- Session Label Example

### 3.2.1 The Session Label

Each Oracle Label Security user has a set of authorizations that include:

- A maximum and minimum level

- A set of authorized compartments

- A set of authorized groups

- For each compartment and group, a specification of read-only access, or read/write access

The administrator also specifies the user's initial session label when setting up these authorizations for the user.

The session label is the particular combination of level, compartments, and groups at which a user works at any given time. The user can change the session label to any combination of components for which the user is authorized.

See Also: "Changing Your Session and Row Labels with SA_SESSION"

### 3.2.2 The Row Label

When a user writes data without specifying its label, a row label is assigned automatically, using the user's session label. However, the user can set the label for the written row, within certain restrictions on the components of the label he specifies.

The level of this label can be set to any level within the range specified by the administrator. For example, it can be set to the level of the user's current session label down to the user's minimum level. However, the compartments and groups for this row's new label are more restricted. The new label can include only those compartments and groups contained in the current session label and, among those, only the ones for which the user has write access.

When the administrator sets up the user authorizations, he or she also specifies an initial default row label.

See Also: "Managing User Labels by Component, with SA_USER_ADMIN" "Changing Your Session and Row Labels with SA_SESSION"

### 3.2.3 Session Label Example

The session label and the row label can fall anywhere within the range of the user's level, compartment, and group authorizations. In Figure 3-2, "User Session Label", the user's maximum level is SENSITIVE and the minimum level is UNCLASSIFIED. However, his default session label is C:FIN,OP:WR. In this example, the administrator has set the user's session label so that the user connects to the database at the CONFIDENTIAL level.

Similarly, although the user is authorized for compartments FIN and OP, and group WR, the administrator could set the session label so that the user connects with only compartment FIN and group WR.

See Also: "SA_USER_ADMIN.SET_COMPARTMENTS" or "SA_USER_ADMIN.ALTER_COMPARTMENTS"

Figure 3-2 User Session Label

Description of "Figure 3-2 User Session Label"

## 3.3 Understanding User Authorizations

There are two types of user authorizations:

- Authorizations Set by the Administrator

- Computed Session Labels

### 3.3.1 Authorizations Set by the Administrator

The administrator explicitly sets a number of user authorizations:

- Authorized Levels

- Authorized Compartments

- Authorized Groups

#### 3.3.1.1 Authorized Levels

The administrator explicitly sets the following level authorizations:

Table 3-1 Authorized Levels Set by the Administrator

Authorization | Meaning
--- | ---
User Max Level | The maximum ranking of sensitivity that a user can access during read and write operations
User Min Level | The minimum ranking of sensitivity that a user can access during write operations. The User Max Level must be equal to or greater than the User Min Level.
User Default Level | The level that is assumed by default when connecting to Oracle Database
User Default Row Level | The level that is used by default when inserting data into Oracle Database

For example, in Oracle Policy Manager, the administrator might set the following authorizations:

Figure 3-3 Setting Up Authorized Levels

Description of "Figure 3-3 Setting Up Authorized Levels"

#### 3.3.1.2 Authorized Compartments

The administrator specifies the list of compartments that a user can place in their session label. Write access must be explicitly given for each compartment. A user cannot directly insert, update, or delete a row that contains a compartment that she does not have authorization to write. For example, in Oracle Policy Manager, the administrator might set the following authorizations:

Figure 3-4 Setting Up Authorized Compartments

Description of "Figure 3-4 Setting Up Authorized Compartments"

In Figure 3-4, "Setting Up Authorized Compartments", the row designation indicates whether the compartment should be used as part of the default row label for newly inserted data. Note also that the LABEL_DEFAULT policy option must be in effect for this setting to be valid.

#### 3.3.1.3 Authorized Groups

The administrator specifies the list of groups that a user can place in session label. Write access must be explicitly given for each group listed. For example, in Oracle Policy Manager, the administrator might set the following authorizations:

Figure 3-5 Setting Up Authorized Groups

Description of "Figure 3-5 Setting Up Authorized Groups"

In Figure 3-5, "Setting Up Authorized Groups", the row designation indicates whether the group should be used as part of the default row label for newly inserted data. Note also that the LABEL_DEFAULT policy option must be in effect for this setting to be valid.

See Also: Chapter 7, "Administering User Labels and Privileges" for instructions on setting the authorizations "LABEL_DEFAULT: Using the Session's Default Row Label"

### 3.3.2 Computed Session Labels

Oracle Label Security automatically computes a number of labels based on the value of the session label. These include:

Table 3-2 Computed Session Labels

Computed Label | Definition
--- | ---
Maximum Read Label | The user's maximum level combined with any combination of compartments and groups for which the user is authorized.
Maximum Write Label | The user's maximum level combined with the compartments and groups for which the user has been granted write access.
Minimum Write Label | The user's minimum level.
Default Read Label | The single default level combined with compartments and groups that have been designated as default for the user.
Default Write Label | A subset of the default read label, containing the compartments and groups to which the user has been granted write access. The level component is equal to the level default in the read label. This label is automatically derived from the read label based on the user's write authorizations.
Default Row Label | The combination of components between the user's minimum write label and the maximum write label, which has been designated as the default value for the data label for inserted data.

See Also: "Computed Labels with Inverse Groups"

## 3.4 Evaluating Labels for Access Mediation

When a table is protected by an Oracle Label Security policy, the user's label components are compared to the row's label components to determine whether the user can access the data. In this way, Oracle Label Security evaluates whether the user is authorized to perform the requested operation on the data in the row. This section explains the rules and options by which user access is mediated. It contains these topics:

- Introducing Read/Write Access

- The Oracle Label Security Algorithm for Read Access

- The Oracle Label Security Algorithm for Write Access

### 3.4.1 Introducing Read/Write Access

Although data labels are stored in a column within data records, information about user authorizations is stored in relational tables. When a user logs on, the tables are used to dynamically generate user labels for use during the session.

#### 3.4.1.1 Difference Between Read and Write Operations

Two fundamental types of access mediation on Data Manipulation language (DML) operations exist, within protected tables:

- Read access

- Write access

The user has a maximum authorization for the data he or she can read; the user's write authorization is a subset of that. The minimum write level controls the user's ability to disseminate data by lowering its sensitivity. The user cannot write data with a level lower than the minimum level the administrator assigned to this user.

In addition, there are separate lists of compartments and groups for which the user is authorized; that is, for which the user has at least read access. An access flag indicates whether the user can also write to individual compartments or groups.

#### 3.4.1.2 Propagation of Read/Write Authorizations on Groups

When groups are organized hierarchically, a user's assigned groups include all subgroups that are subordinate to the group to which she belongs. In this case, the user's read/write authorizations on a parent group flow down to all the subgroups.

Consider the parent group WESTERN_REGION, with three subgroups as illustrated in Figure 3-6, "Subgroup Inheritance of Read/Write Access". If the user has read access to WESTERN_REGION, then the read access is also granted to the three subgroups. The administrator can give the user write access to subgroup WR_FINANCE, without granting write access to the WESTERN_REGION parent group (or to the other subgroups). On the other hand, if the user has read/write access on WESTERN_REGION, then read/write access is also granted on all of the subgroups subordinate to it in the tree.

Write authorization on a group does not give a user write authorization on the parent group. If a user has read-only access to WESTERN_REGION and WR_FINANCE, then the administrator can grant write access to WR_ACCOUNTS_RECEIVABLE, without affecting the read-only access to the higher-level groups.

Figure 3-6 Subgroup Inheritance of Read/Write Access

Description of "Figure 3-6 Subgroup Inheritance of Read/Write Access"

See Also: "Introduction to User Label and Privilege Management" "How Inverse Groups Work"

### 3.4.2 The Oracle Label Security Algorithm for Read Access

The READ_CONTROL enforcement determines the ability to read data in a row. The following rules are used, in the sequence listed, to determine a user's read access to a row of data:

1. The user's level must be greater than or equal to the level of the data.

2. The user's label must include at least one of the groups that belong to the data (or the parent group of one such subgroup).

3. The user's label must include all the compartments that belong to the data.

If the user's label passes these tests, then it is said to dominate the row's label.

Note that there is no notion of read or write access connected with levels. This is because the administrator specifies a range of levels (minimum to maximum) within which a user can potentially read and write. At any time, the user can read all data equal to or less than the current session level. No privileges (other than FULL) allow the user to write below the minimum authorized level.

The label evaluation process proceeds from levels to groups to compartments, as illustrated in Figure 3-7, "Label Evaluation Process for Read Access". Note that if the data label is null or invalid, then the user is denied access.

Figure 3-7 Label Evaluation Process for Read Access

Description of "Figure 3-7 Label Evaluation Process for Read Access"

As a read access request comes in, Oracle Label Security evaluates each row to determine the following:

1. Is the user's level equal to, or greater than, the level of the data?

2. If so, does the user have access to at least one of the groups present in the data label?

3. If so, does the user have access to all the compartments present in the data label? (That is, are the data's compartments a subset of the user's compartments?)

If the answer is no at any stage in this evaluation process, then Oracle Label Security denies access to the row and moves on to evaluate the next row of data.

Oracle Label Security policies allow user sessions to read rows at their label and below, which is called reading down. Sessions cannot read rows at labels that they do not dominate.

For example, if you are logged in at SENSITIVE:ALPHA,BETA, you can read a row labeled SENSITIVE:ALPHA because your label dominates that of the row. However, you cannot read a row labeled SENSITIVE:ALPHA,GAMMA because your label does not dominate that of the row.

Note that the user can gain access to the rows otherwise denied, if she or he has special Oracle Label Security privileges.

See Also: "Privileges Defined by Oracle Label Security Policies" "The Access Control Enforcement Options" "Algorithm for Read Access with Inverse Groups" "Analyzing the Relationships Between Labels"

### 3.4.3 The Oracle Label Security Algorithm for Write Access

In the context of Oracle Label Security, WRITE_CONTROL enforcement determines the ability to insert, update, or delete data in a row.

WRITE_CONTROL enables you to control data access with ever finer granularity. Granularity increases when compartments are added to levels. It increases again when groups are added to compartments. Access control becomes even more fine grained when you can manage the user's ability to write the data that he can read.

To determine whether a user can write a particular row of data, Oracle Label Security evaluates the following rules, in the order given:

1. The level in the data label must be greater than or equal to the user's minimum level and less than or equal to the user's session level.

2. When groups are present, the user's label must include at least one of the groups with write access that appear in the data label (or the parent of one such subgroup). In addition, the user's label must include all the compartments in the data label.

3. When no groups are present, the user's label must have write access on all of the compartments in the data label.

To state tests 2 and 3 another way:

- If the label has no groups, then the user must have write access on all the compartments in the label in order to write the data.

- If the label does have groups and the user has write access to one of the groups, she only needs read access to the compartments in order to write the data.

Just as with read operations, the label evaluation process proceeds from levels to groups to compartments. Note that the user cannot write any data below the authorized minimum level, nor above the current session level. The user can always read below the minimum level.

The following figure illustrates how the process works with INSERT, UPDATE, and DELETE operations. Note that if the data label is null or invalid, then the user is denied access.

Figure 3-8 Label Evaluation Process for Write Access

Description of "Figure 3-8 Label Evaluation Process for Write Access"

As an access request comes in, Oracle Label Security evaluates each row to determine the following:

1. Is the data's level equal to, or less than the level of the user?

2. Is the data's level equal to, or greater than the user's minimum level?

3. If the data's level falls within the foregoing bounds, then does the user have write access to at least one of the groups present in the data label?

4. If so, does the user have access to all the compartments with at least read access that are present in the data label?

5. If there are no groups but there are compartments, then does the user have write access to all of the compartments?

If the answer is no at any stage in this evaluation process, then Oracle Label Security denies access to the row, and moves on to evaluate the next row of data.

Consider a situation in which your session label is S:ALPHA,BETA but you have write access to only compartment ALPHA. In this case, you can read a row with the label S:ALPHA,BETA but you cannot update it.

In summary, write access is enforced on INSERT, UPDATE and DELETE operations upon the data in the row.

In addition, each user may have an associated minimum level below which the user cannot write. The user cannot update or delete any rows labeled with levels below the minimum, and cannot insert a row with a row label containing a level less than the minimum.

See Also: "The Access Control Enforcement Options" "Algorithm for Write Access with Inverse Groups"

## 3.5 Using Oracle Label Security Privileges

This section introduces the Oracle Label Security database and row label privileges:

- Privileges Defined by Oracle Label Security Policies

- Special Access Privileges

- Special Row Label Privileges

- System Privileges, Object Privileges, and Policy Privileges

### 3.5.1 Privileges Defined by Oracle Label Security Policies

Oracle Label Security supports special privileges that allow authorized users to bypass certain parts of the policy. Table 3-3 summarizes the full set of privileges that can be granted to users or trusted stored program units. Each privilege is more fully discussed after the table.

Table 3-3 Oracle Label Security Privileges

Security Privilege | Explanation
--- | ---
READ | Allows read access to all data protected by the policy
FULL | Allows full read and write access to all data protected by the policy
COMPACCESS | Allows a session access to data authorized by the row's compartments, independent of the row's groups
PROFILE_ACCESS | Allows a session to change its labels and privileges to those of a different user
WRITEUP | Allows users to set or raise only the level, within a row label, up to the maximum level authorized for the user. (Active only if LABEL_UPDATE is active.)
WRITEDOWN | Allows users to set or lower the level, within a row label, to any level equal to or greater than the minimum level authorized for the user. (Active only if LABEL_UPDATE is active.)
WRITEACROSS | Allows a user to set or change groups and compartments of a row label, but does not allow changes to the level. (Active only if LABEL_UPDATE is active.)

### 3.5.2 Special Access Privileges

A user's authorizations can be modified with any of four privileges:

- READ

- FULL

- COMPACCESS

- PROFILE_ACCESS

#### 3.5.2.1 READ

A user with the READ privilege can read all data protected by the policy, regardless of the authorizations or session label. The user does not even need to have label authorizations. Note, in addition, that a user with READ privilege can write to any data rows for which he or she has write access, based on any label authorizations.

Note: However, access mediation is still enforced on UPDATE, INSERT, and DELETE operations. Refer to Chapter 8, "Implementing Policy Enforcement Options and Labeling Functions", particularly "Overview of Policy Enforcement Options", Table 8-2, "Policy Enforcement Options", and "The Access Control Enforcement Options".

This privilege is useful for system administrators who need to export data but who should not be allowed to change data. It is also useful for people who must run reports and compile information but not change data. The READ privilege enables optimal performance on SELECT statements, because the system behaves as though the Oracle Label Security policy were not even present.

#### 3.5.2.2 FULL

The FULL privilege has the same effect and benefits as the READ privilege, with one difference. A user with the FULL privilege can also write to all the data. For a user with the FULL privilege, the READ and WRITE algorithms are not enforced.

Note that Oracle system and object authorizations are still enforced. For example, a user must still have SELECT on the application table. The FULL authorization turns off the access mediation check at the individual row level.

#### 3.5.2.3 COMPACCESS

The COMPACCESS privilege allows a user to access data based on the row label's compartments, independent of the row label's groups. If a row label has no compartments, then access is determined by the group authorizations. However, when compartments do exist and access to them is authorized, then the group authorization is bypassed. This allows a privileged user whose label matches all the compartments of the data to access any data in any particular compartment, independent of what groups may own or otherwise be allowed access to the data.

Figure 3-9, "Label Evaluation Process for Read Access with COMPACCESS Privilege" shows the label evaluation process for read access with the COMPACCESS privilege. Note that if the data label is null or invalid, then the user is denied access.

Figure 3-9 Label Evaluation Process for Read Access with COMPACCESS Privilege

Description of "Figure 3-9 Label Evaluation Process for Read Access with COMPACCESS Privilege"

Figure 3-10, "Label Evaluation Process for Write Access with COMPACCESS Privilege" shows the label evaluation process for write access with COMPACCESS privilege. Note that if the data label is null or invalid, then the user is denied access.

Figure 3-10 Label Evaluation Process for Write Access with COMPACCESS Privilege

Description of "Figure 3-10 Label Evaluation Process for Write Access with COMPACCESS Privilege"

#### 3.5.2.4 PROFILE_ACCESS

The PROFILE_ACCESS privilege allows a session to change its session labels and session privileges to those of a different user. This is a very powerful privilege, because the user can potentially become a user with FULL privileges. This privilege cannot be granted to a trusted stored program unit.

### 3.5.3 Special Row Label Privileges

Once the label on a row has been set, Oracle Label Security privileges are required to modify the label. These privileges include WRITEUP, WRITEDOWN, and WRITEACROSS.

Note that the LABEL_UPDATE enforcement option must be on for these label modification privileges to be enforced. When a user updates a row label, the new label and old label are compared, and the required privileges are determined.

#### 3.5.3.1 WRITEUP

The WRITEUP privilege enables the user to raise the level of data within a row, without compromising the compartments or groups. The user can raise the level up to his or her maximum authorized level.

For example, an authorized user can raise the level of a data row that has a level lower than his own minimum level. If a row is UNCLASSIFIED and the user's maximum level is SENSITIVE, then the row's level can be raised to SENSITIVE. It can be raised above the current session level, but it cannot change the compartments.

#### 3.5.3.2 WRITEDOWN

The WRITEDOWN privilege enables the user to lower the level of data within a row, without compromising the compartments or groups. The user can lower the level to any level equal to or greater than his or her minimum authorized level.

#### 3.5.3.3 WRITEACROSS

The WRITEACROSS privilege allows the user to change the compartments and groups of data, without altering its sensitivity level. This guarantees, for example, that SENSITIVE data remains at the SENSITIVE level, but at the same time enables the data's dissemination to be managed. JEL: Any restrictions, like for Up and Down? Can user write a label specifying a group or compartment he doesn't share? ??JEL

It lets the user change compartments and groups to anything that is currently defined as a valid compartment or group within the policy, while maintaining the level. With the WRITEACROSS privilege, a user with read access to one group (or more) can write to a different group without explicitly being given access to it.

### 3.5.4 System Privileges, Object Privileges, and Policy Privileges

Remember that Oracle Label Security privileges are different from the standard Oracle Database system and object privileges.

Table 3-4 Types of Privilege

Source | Privileges | Definition
--- | --- | ---
Oracle Database | System Privileges | The right to run a particular type of SQL statement
| Object Privileges | The right to access another user's object
Oracle Label Security | Policy Privileges | The ability to bypass certain parts of the label security policy

Oracle Database enforces the discretionary access control privileges that a user has been granted. By default, a user has no privileges except those granted to the PUBLIC user group. A user must explicitly be granted the appropriate privilege to perform an operation.

For example, to read an object in Oracle Database, you must either be the object's owner, or be granted the SELECT privilege on the object, or be granted the SELECT ANY TABLE system privilege. Similarly, to update an object, you must either be the object's owner, or be granted the UPDATE privilege on the object, or be granted the UPDATE ANY TABLE privilege.

See Also: For more information about which Oracle Database privileges are required to perform a certain operation and how to grant and revoke these discretionary access control privileges, see Oracle Database Administrator's Guide

### 3.5.5 Access Mediation and Views

Prior to accessing data through a view, the users must have the appropriate system and object privileges on the view. If the underlying table (on which the view is based) is protected by Oracle Label Security, then the user of the view must have authorization from Oracle Label Security to access specific rows of labeled data.

### 3.5.6 Access Mediation and Program Unit Execution

In Oracle Database, if User1 executes a procedure that belongs to User2, the procedure runs with User2's system and object privileges. However, any procedure executed by User1 runs with User1's own Oracle Label Security labels and privileges. This is true even when User1 executes stored program units owned by other users.

Figure 3-11, "Stored Program Unit Execution" illustrates this process:

- Stored program units run with the DAC privileges of the procedure's owner (User2).

- In addition, stored program units accessing tables protected by Oracle Label Security mediate access to data rows based on the label attached to the row, and the Oracle Label Security labels and privileges of the invoker of the procedure (User1).

Figure 3-11 Stored Program Unit Execution

Description of "Figure 3-11 Stored Program Unit Execution"

Stored program units can become trusted when an administrator assigns them Oracle Label Security privileges. A stored program unit can be run with its own autonomous Oracle Label Security privileges rather than those of the user who calls it. For example, if you possess no Oracle Label Security privileges in your own right but run a stored program unit that has the WRITEDOWN privilege, then you can update labels. In this case, the privileges used are those of the stored program unit, and not your own.

Trusted program units can encapsulate privileged operations in a controlled manner. By using procedures, packages, and functions with assigned privileges, you may be able to access data that your own labels and privileges would not authorize. For example, to perform aggregate functions over all data in a table, not just the data visible to you, you might use a trusted program set up by an administrator. This way program units can thus perform operations on behalf of users, without the need to grant privileges directly to users.

See Also: Chapter 10, "Administering and Using Trusted Stored Program Units"

### 3.5.7 Access Mediation and Policy Enforcement Options

An administrator can choose from among a set of policy enforcement options when applying an Oracle Label Security policy to individual tables. These options enable enforcement to be tailored differently for each database table. In addition to the access controls based on the labels, a SQL predicate can also be associated with each table. The predicate can further define which rows in the table are accessible to the user. Policy enforcement options and predicates are discussed in Chapter 8, "Implementing Policy Enforcement Options and Labeling Functions".

In cases where the label to be associated with a new or updated row should be automatically computed, an administrator can specify a labeling function when applying the policy. That function will thereafter always be invoked to provide the data labels written under that policy, because active labeling functions take precedence over any alternative means of supplying a label.

Except where noted, this guide assumes that all enforcement options are in effect.

See Also: "Using a Labeling Function" "Applying a Policy with SA_POLICY_ADMIN.APPLY_SCHEMA_POLICY"

## 3.6 Working with Multiple Oracle Label Security Policies

This section describes aspects of using multiple policies.

### 3.6.1 Multiple Oracle Label Security Policies in a Single Database

Several Oracle Label Security policies may be protecting data in a single database. Each defined policy is associated with a set of labels used only by that policy. Data labels are constrained by the set of defined labels for each policy.

Each policy may protect a different table, but multiple policies can also apply to a single table. To access data, you must have label authorizations for all policies protecting that data. To access any particular row, you must be authorized by all policies protecting the table containing your desired rows. If you require privileges, then you may need privileges for all of the policies affecting your work.

### 3.6.2 Multiple Oracle Label Security Policies in a Distributed Environment

If you work in a distributed environment, where multiple databases may be protected by the same or different Oracle Label Security policies, your remote connections will also be controlled by Oracle Label Security.

See Also: Chapter 12, "Using Oracle Label Security with a Distributed Database"